ostree-repo-pull: always initialize flags_i
authorJonathan Lebon <jlebon@redhat.com>
Mon, 11 Apr 2016 13:27:35 +0000 (09:27 -0400)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Mon, 11 Apr 2016 13:31:20 +0000 (13:31 +0000)
Otherwise we get undefined behaviour if the client didn't explicitly set
any flags.

Also, add documentation for all the other options supported by
ostree_repo_pull_with_options().

Closes: #252
Approved by: cgwalters

src/libostree/ostree-repo-pull.c
src/libostree/ostree-repo.c

index 8eca91c35bb7dfc1a3ed4986bd7c5c4ee481157f..e86ede50e02c67e924cafda7c306ed100a87293e 100644 (file)
@@ -1908,7 +1908,7 @@ ostree_repo_pull_with_options (OstreeRepo             *self,
 
   if (options)
     {
-      int flags_i;
+      int flags_i = OSTREE_REPO_PULL_FLAGS_NONE;
       (void) g_variant_lookup (options, "refs", "^a&s", &refs_to_fetch);
       (void) g_variant_lookup (options, "flags", "i", &flags_i);
       /* Reduce risk of issues if enum happens to be 64 bit for some reason */
index 47519e66121e3d4714c0a1bc8b8c9c740f2b4327..d59c8e7809b6b9233617209bccac233c4549d208 100644 (file)
@@ -3999,11 +3999,17 @@ ostree_repo_pull_one_dir (OstreeRepo               *self,
  * Like ostree_repo_pull(), but supports an extensible set of flags.
  * The following are currently defined:
  *
- *   * subdir (s): Pull just this subdirectory
+ *   * refs (as): Array of string refs
  *   * flags (i): An instance of #OstreeRepoPullFlags
- *   * refs: (as): Array of string refs
- *   * depth: (i): How far in the history to traverse; default is 0, -1 means infinite
- *   * override-commit-ids: (as): Array of specific commit IDs to fetch for refs
+ *   * subdir (s): Pull just this subdirectory
+ *   * override-remote-name (s): If local, add this remote to refspec
+ *   * gpg-verify (b): GPG verify commits
+ *   * gpg-verify-summary (b): GPG verify summary
+ *   * depth (i): How far in the history to traverse; default is 0, -1 means infinite
+ *   * disable-static-deltas (b): Do not use static deltas
+ *   * require-static-deltas (b): Require static deltas
+ *   * override-commit-ids (as): Array of specific commit IDs to fetch for refs
+ *   * dry-run (b): Only print information on what will be downloaded (requires static deltas)
  */
 gboolean
 ostree_repo_pull_with_options (OstreeRepo             *self,